//
//  utility.m
//  mid
//
//  Created by itlab on 2020/12/4.
//  Copyright © 2020 itlab. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "utility.h"

UIImage* scaleToSize(UIImage *img, CGSize new_size){
    UIGraphicsBeginImageContext(new_size);
    [img drawInRect:CGRectMake(0, 0, new_size.width, new_size.height)];
    UIImage *scaledImg = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return scaledImg;
}
